package com.web.exiaodao.remote.vo;

import com.web.exiaodao.business.constant.JConstant;
import com.web.webstart.base.util.XaUtil;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * @author eason.zt
 * @ClassName: ShopStandardNameVo
 * @Description:商品规格名 Vo
 * @date 2016-11-14 11:27:38
 */
@ApiModel(value = "商品规格名Vo对象")
public class ShopStandardNameVo {

    @ApiModelProperty(value = "主键，自动增长")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    private String createTime;

    @ApiModelProperty(value = "商品id,商品id")
    private Long shopId;
    @ApiModelProperty(value = "规格名称,规格名称")
    private String shopStandsName;

    @ApiModelProperty(value = "规格值,规格值")
    private List<ShopStandardValuesVo> shopStandsValues = new ArrayList<>();
    private String shopStandsValuesStr;//规格名称的字符串,用逗号分割

    public ShopStandardNameVo(Long id, Long shopId, String shopStandName) {
        this.id = id;
        this.shopId = shopId;
        this.shopStandsName = shopStandName;
    }

    public ShopStandardNameVo() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopStandsName(String shopStandsName) {
        this.shopStandsName = shopStandsName;
    }

    public String getShopStandsName() {
        return shopStandsName;
    }

    public List<ShopStandardValuesVo> getShopStandsValues() {
        return shopStandsValues == null ? new ArrayList<ShopStandardValuesVo>() : shopStandsValues;
    }

    public void setShopStandsValues(List<ShopStandardValuesVo> shopStandsValues) {
        this.shopStandsValues = shopStandsValues;
        if (XaUtil.isEmpty(this.shopStandsValues)) {
            this.shopStandsValuesStr = "";
        } else {
            List<String> list = new ArrayList<>();
            for (int i = 0; i < this.shopStandsValues.size(); ++i) {
                String valueStr = shopStandsValues.get(i).getShopStandsValue();
                list.add(valueStr);
            }
            this.shopStandsValuesStr = org.apache.commons.lang3.StringUtils.join(list, JConstant.SYMBOL_DOT);
        }
    }

    public String getShopStandsValuesStr() {
        return shopStandsValuesStr;
    }
}

